﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;

namespace Charisma.Tests
{
    public static class EntityMemberConfiguratorExtensions
    {
        private static FieldInfo member;
        private static FieldInfo isIgnored;

        public static MemberInfo GetMember(this EntityMemberConfigurator configurator)
        {
            return (MemberInfo)member.GetValue(configurator);
        }

        public static bool GetIsIgnored(this EntityMemberConfigurator configurator)
        {
            return (bool)isIgnored.GetValue(configurator);
        }

        static EntityMemberConfiguratorExtensions()
        {
            var c = typeof(EntityMemberConfigurator);
            member = c.GetField("Member", BindingFlags.Instance | BindingFlags.NonPublic);
            isIgnored = c.GetField("IsIgnored", BindingFlags.Instance | BindingFlags.NonPublic);
        }
    }
}
